<%@ page language="java" import="java.util.*,com.hs.dict.model.*,com.hs.core.utils.*,com.hs.core.cache.*" pageEncoding="utf-8"%>
<% 
    String dictname = (String)request.getAttribute("dictname");
  String dicttype = (String)request.getAttribute("dicttype");
  PageUtil pageUtil = (PageUtil)request.getAttribute("dictList");
   String orderName = (String)request.getAttribute("orderName");
	String orderNum = (String)request.getAttribute("orderNum"); 
  
  Map menu = (Map)request.getAttribute("menu");
   
  String pageStr = ""; 
    int perpageCount = 1;
	int currentPage = 1;
	List dataList = null;
	if(null != pageUtil){
   dataList = pageUtil.getPageList();
   pageStr = pageUtil.getPageStr();
   perpageCount = pageUtil.getNumberPerPage();
   currentPage = pageUtil.getCurrentPage();
} 

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title></title>
<%@ include file="../include.jsp"%>   
<style>.tac{text-align:center}</style>
<script>
function searchData(){

searchform.submit();
}

function modifyData(id){
	
     window.parent.dictinfo.frameElement.src = "<%=basePath%>dict/addDict.do?id="+id; 
 
}
 function delDict(id){
 	if(confirm("确定要删除该用户数据项吗?")){
 		dictdwr.delDict(id,callback4delete);
 	}
 }
 function callback4delete(){
    alert("成功删除数据项!"); 
	searchData();
 }
 function addDict(){
 	     window.parent.dictinfo.frameElement.src = "<%=basePath%>dict/addDict.do"; 
 	
 
 }
</script>
</head>
<body>
<div class="contlist"> 
<form name="searchform" action="<%=basePath %>dict/listDict.do" method="post">
<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom:0" class="sear">
    <tr>
                    <td class="tar">
                     <label>字典名称：
                     <input   name ="dictname"  style="width:300px" value="<%=dictname==null?"":dictname %>"  /> 
                     <input type="hidden" name="dicttype" value="<%=dicttype==null?"":dicttype%>"  />     </label>
                     
                     
                     <input onclick="searchData();" type="button" value="查询" class="btn btn-primary"/> 
		             <input onclick="addDict();" type="button" value="新增" class="btn btn-primary"/>  
                    </td>  
                  </tr>
                </table> 
       
</form>

       <div class="listWrap">
        <table border="0" cellpadding="0" cellspacing="0" width="98%" class="tableList">
          <tr> 
            <th width="5%">序号</th>
		    <th width="25%">字典类型</th>
		    <th width="25%">字典名称</th> 
		    <th width="25%">字典编码</th>
		    <th width="25%">是否默认值</th>
 		    <!--  th width="10%">修改</th> 
		    <th width="10%">删除</th--> 
          </tr>
          <%if(null != dataList && dataList.size()>0){ 
		       for(int i =0;i<dataList.size();i++){
		            HsCode data = (HsCode)dataList.get(i);
		            int j = i%2;
		            boolean flag = false;
		            if(j==0)
		               flag = true;
  			%> 
	  <TR>
	    <TD align=center><%= perpageCount*(currentPage-1)+i+1 %></TD>
	    <TD><%=DictCacheUtil.getInst().selectStr4Display(data.getDicttype()+"","1")%></TD>
	    <TD><%=StringUtilTool.NULL2Blank(data.getDictname()) %></TD> 
	    <TD><%=data.getDictcode() %></TD> 
	    <TD align="center"><%if("1".equals(data.getIsdefault()+"")){out.println("是");}else{out.print("否");}%></TD> 
 	     
	    <!--  TD><input type="button" value=" 修 改 " onclick="modifyData('<%=data.getId() %>');"></TD>
	    <TD><input type="button" value=" 删 除 " onclick="delDict('<%=data.getId() %>');"></TD-->
	  
	    </TR>
	     
     <%}%>
     <tr>
          <td colspan=7>
          <%=pageStr  %>
          </td>
         </tr> 
     <% }else{ %>
         <TR  align="center">
	    	<TD colspan="5"><font color="red"><b>没有字典配置记录</b></font></TD> 
	    </TR>  
	     <%} %> 
         
        </table>  
        </div>
        </div>
</body>
</html>
